<?php
namespace app\admin\controller;

use app\admin\module\FileModule;
use app\BaseController;
use app\Request;

class File extends BaseController{

    public function upload(Request $request){
        $file = $request->file('file');
        $name = $request->param('name');
        $path = FileModule::upload($file,$name);
        return $this->success('上传成功',$path);
    }

    public function wangeditorimg(Request $request)
    {
        $file = $request->file('file');
        $name = '编辑器图片';
        $path = FileModule::upload($file, $name);
        return $this->success('上传成功',$path);
    }

}